<script>
    //打印

    $('report').addEvent('click', function () {
  var begin_date = $('begin_date').get('value');
        var begin_date_objh = document.getElementsByName("_DTIME_[H][begin_date]")[0];
        var begin_date_h = begin_date_objh.options[begin_date_objh.selectedIndex].value;
        var begin_date_objm = document.getElementsByName("_DTIME_[M][begin_date]")[0];
        var begin_date_m = begin_date_objm.options[begin_date_objm.selectedIndex].value;
        begin_date = begin_date + " " + begin_date_h + ":" + begin_date_m;
        begin_date = new Date(begin_date).getTime();

        var end_date = $('end_date').get('value');
        var end_date_objh = document.getElementsByName("_DTIME_[H][end_date]")[0];
        var end_date_h = end_date_objh.options[end_date_objh.selectedIndex].value;
        var end_date_objm = document.getElementsByName("_DTIME_[M][end_date]")[0];
        var end_date_m = end_date_objm.options[end_date_objm.selectedIndex].value;
        end_date = end_date + " " + end_date_h + ":" + end_date_m;
        end_date = new Date(end_date).getTime();
        var logi_name=$('logi_name').get('value');
        var shop_id=$('shop_id').get('value');
        var url = "index.php?app=omeanalysts&ctl=analysis_logireport&act=report";
        url +='&begin_date=' + begin_date + '&end_date=' + end_date+"&logi_name="+logi_name+"&shop_id="+shop_id;
        window.open(url);
    });

</script>
<div class="tableform">
    <h3>快递数据查询报表</h3>

    <form id="Searchform" action="index.php?app=omeanalysts&ctl=analysis_logireport&act=index" method="post">
       <div class="division">

        <table width='100%' cellspacing="0" cellpadding="0" >

             <tr>
               <td>  
               店铺：
                <select name="shop_id" id="shop_id">
                    <{foreach from=$shop_data key=key item=val}>
                        <option value="<{$key}>" <{if  $clearingtable.shop_id==$key }>selected<{/if}>><{$val}></option>
                    <{/foreach}>
                </select>
                仓库：
                <select name="branch_id" id="branch_id">
                    <{foreach from=$branch_data key=key item=val}>
                        <option value="<{$key}>" <{if  $clearingtable.branch_id==$key }>selected<{/if}>><{$val}></option>
                    <{/foreach}>
                </select>
                查询日期：
                <{input type="time" name="begin_date" vtype="required" id="begin_date" value="{$clearingtable.begin_date}" }>
                至：<{input type="time" value="{$clearingtable.end_date}"  id="end_date"  name="end_date"}>
                快递：
                <select name="logi_name" id="logi_name">
                    <!-- 20191109 快递公司只保留邮政快递公司 -->
                    <option value="6" <{if  $clearingtable.logi_name==6 }>selected<{/if}>>邮政快递包裹</option>
                    <option value="15" <{if  $clearingtable.logi_name==15 }>selected<{/if}> >无界邮政</option>
                    <option value="23" <{if  $clearingtable.logi_name==23 }>selected<{/if}> >拼多多邮政</option>
                    <option value="26" <{if  $clearingtable.logi_name==19 }>selected<{/if}> >新疆奎屯邮政</option>
                </select>
                 <{button class="btn btn-primary" type="submit" id="saveCurrent" label="查询"}>
                 <{button class="btn btn-primary" type="button" id="report" label="导出"}>
                </td>
              </tr>
             
        </table>

   </div>

</form>

    </form>

    <div class="division" id="accordion" style="width:1200px;">

        <table width="1100px" cellspacing="0" cellpadding="0" class="gridlist">
            <thead>
            <tr>
                <th style="width:110px;">店铺编码</th>
                <th style="width:110px;">店铺名称</th>
                <th style="width:110px;">发货单号</th>
                <th style="width:120px;">发货时间</th>
                <th style="width:100px;">物流单号</th>
                <th style="width:50px;">重量</th>
                <th style="width:100px;">收货人姓名</th>
                <th style="width:110px;">收货人手机</th>
                <th style="width:110px;">收货人电话</th>
                <th style="width:200px;">收货地区</th>
                <th style="width:200px;">收货地址</th>
                <th style="width:200px;">仓库</th>
            </tr>
            </thead>

            <{foreach from=$logi_data item=his}>

            <{assign var="key1" value="0"}>
            <{assign var="key2" value="0"}>
            <{assign var="key3" value="0"}>
            <{assign var="key4" value="0"}>
            <{assign var="key5" value="0"}>
            <{assign var="key6" value="0"}>
            <{assign var="key7" value="0"}>
            <{assign var="key8" value="0"}>
            <{assign var="key9" value="0"}>

            <tbody>
            <tr>

                <td><{$his.shop_bn}></td>
                <td><{$his.shop_name}></td>
                <td><{$his.delivery_bn}></td>
                <td><{$his.delivery_time}></td>
                <td><{$his.logi_no}></td>
                <td><{$his.weight}></td>
                <td><{$his.ship_name}></td>
                <td><{$his.ship_mobile}></td>
                <td><{$his.ship_tel}></td>
                <td><{$his.ship_area}></td>
                <td><{$his.ship_addr}></td>
                <td><{$his.b_name}></td>

            </tr>

            </tbody>

            <{/foreach}>
        </table>
    </div>

    <div class="division">
    </div>
</div>
